package com.ycw.controller.wang;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ycw.bean.QuestionAll;
import com.ycw.service.wang.QuestionAllService;
import com.ycw.util.Msg;

@Controller
public class WangwangQuestionController {

	@Autowired
	QuestionAllService questionAllService;

	// 查询所有父问题
	@RequestMapping("/getAllQuestionAll")
	@ResponseBody
	public Msg getAllQuestionAll() {
		List<QuestionAll> question = questionAllService.getAllQuestionAll();
		return Msg.success().add("question", question);
	}

	// 添加父问题
	@RequestMapping("/addQusetionAll")
	@ResponseBody
	public Msg addQusetionAll(QuestionAll question) {
		boolean f = questionAllService.addQusetionAll(question);
		return Msg.success().add("question", question);
	}

	// 修改父问题
	@RequestMapping("/updateQuestion")
	@ResponseBody
	public Msg updateQuestion(QuestionAll question) {
		boolean f = questionAllService.updateQuestion(question);
		return Msg.success().add("question", question);
	}

	// 删除父问提
	@RequestMapping("/deleteQuestion")
	@ResponseBody
	public Msg deleteQuestion(QuestionAll question) {
		boolean f = questionAllService.deleteQuestion(question);
		return Msg.success().add("question", question);
	}
}
